/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bs.converters;

import java.math.BigDecimal;
import org.jdesktop.beansbinding.Converter;

/**
 *
 * @author Bone
 */
public class ConversorBigDecimal extends Converter<BigDecimal, String> {

    @Override
    public String convertForward(BigDecimal value) {
        return String.valueOf(value);
    }

    @Override
    public BigDecimal convertReverse(String value) {
        value = value.replace("R", "");
        value = value.replace("$", "");
        value = value.replace(" ", "");
        return new BigDecimal(value);
    }

}
